package edu.sctu.nieyu.day20150608.calendertest;

import java.text.SimpleDateFormat;
import java.util.GregorianCalendar;

/**
 * Created by user01 on 2015/6/8.
 */
public class TestCalender {

    public void dateMessage(){

        GregorianCalendar g1 = new GregorianCalendar();
        GregorianCalendar g2 = new GregorianCalendar();

        g1.set(2015,5,8,17,00);
        g2.set(2015,5,8,14,00);

        long g3 = Math.abs(g1.getTime().getTime()-g2.getTime().getTime());

        System.out.println(g3);
        System.out.println(new SimpleDateFormat("yyyy-MM-dd hh:mm").format(g1.getTime()));
        System.out.println(new SimpleDateFormat("yyyy-MM-dd hh:mm").format(g2.getTime()));




    }
}
